using Senparc.Weixin.Entities;
using Senparc.Weixin.MP.CommonAPIs;
using System;
namespace Senparc.Weixin.MP.AdvancedAPIs
{
	public static class ExpressApi
	{
		public static AddExpressResult AddExpress(string accessToken, AddExpressData addExpressData)
		{
			string urlFormat = "https://api.weixin.qq.com/merchant/express/add?access_token={0}";
			return CommonJsonSend.Send<AddExpressResult>(accessToken, urlFormat, addExpressData, CommonJsonSendType.POST, 10000, false);
		}
		public static WxJsonResult DeleteExpress(string accessToken, int templateId)
		{
			string urlFormat = "https://api.weixin.qq.com/merchant/express/del?access_token={0}";
			var data = new
			{
				template_id = templateId
			};
			return CommonJsonSend.Send<WxJsonResult>(accessToken, urlFormat, data, CommonJsonSendType.POST, 10000, false);
		}
		public static WxJsonResult UpDateExpress(string accessToken, UpDateExpressData upDateExpressData)
		{
			string urlFormat = "https://api.weixin.qq.com/merchant/express/update?access_token={0}";
			return CommonJsonSend.Send<WxJsonResult>(accessToken, urlFormat, upDateExpressData, CommonJsonSendType.POST, 10000, false);
		}
		public static GetByIdExpressResult GetByIdExpress(string accessToken, int templateId)
		{
			string urlFormat = "https://api.weixin.qq.com/merchant/express/getbyid?access_token={0}";
			var data = new
			{
				template_id = templateId
			};
			return CommonJsonSend.Send<GetByIdExpressResult>(accessToken, urlFormat, data, CommonJsonSendType.POST, 10000, false);
		}
		public static GetAllExpressResult GetAllExpress(string accessToken)
		{
			string urlFormat = "https://api.weixin.qq.com/merchant/express/getall?access_token={0}";
			return CommonJsonSend.Send<GetAllExpressResult>(accessToken, urlFormat, null, CommonJsonSendType.GET, 10000, false);
		}
	}
}
